package com.icss.dao;

import org.apache.ibatis.jdbc.SQL;

import com.icss.entity.Order;


public class OrderPriv {
	public String selectOrder(final Order order) {
		SQL s1=new SQL(){{
			SELECT("corder.Oid,corder.Oamount,corder.SOdate,corder.SOtime,custom.c_name,orderstate.OSname");
			FROM("corder,custom,orderstate");
			WHERE("corder.c_id=custom.c_id and corder.OSid=orderstate.OSid");
			if (order.getOSid()!=null) {
				WHERE("corder.OSid=#{OSid}");
			}
			if(order.getOid()!=null)
			{
			WHERE("corder.Oid=#{oid}");
			}
		}};
		return s1.toString();
	}
}
